import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class DeckTest {
	String [] tab;
	Deck deck= new Deck();
	@Before
	public void setUp() {
		tab=deck.cards;
		deck.shuffle(deck.cards.length);
	}
	@Test
	public void testDifferent () {
		assertNotEquals(deck.cards,tab);
	}
	@Test
	public void testShuffle() {
		String[] tab2;
		tab2=deck.cards;
		int count=deck.cards.length;
		int result=0;
		String chose="";
		for (int a=0 ; a<count ; a++) {	//ta petla sprawdzam czy nie ma powtorzen w potasowanej talii
				chose=tab2[a];
				for (int i=0; i<count; i++) {
						if (chose==tab2[i])
							result++;
				}
				assertEquals(1, result);
				result=0;
		}
	}
	@Test
	public void testDealing() {
		String dealt1=deck.dealing(4);
		String dealt2=deck.dealing(4);
		assertNotEquals(dealt1,dealt2);
	}
	@Test
	public void testChange() {
		String toChange1="As Qh 2s 2d";
		String toChange2="3d 3s 3h 3c";
		String changed1=deck.change(toChange1);
		String changed2=deck.change(toChange2);
		assertNotEquals(changed1, changed2);
	 }
	@Test
	 public void testChangeDeck() {
		String [] help1=deck.help;
		deck.changeDeck();
		assertNotEquals(help1, deck.cards);
	 }
	
	@After
	public void tearDown() {
		deck=null;
	}
}
